package com.suray.basic.wcs.plc.pojo.oper.single.lifter;

import com.suray.basic.wcs.plc.core.PlcOffset;
import com.suray.basic.wcs.plc.enums.Location;
import com.suray.basic.wcs.plc.enums.PlcDeviceType;
import com.suray.basic.wcs.plc.pojo.DeviceBase;
import com.suray.basic.wcs.utils.Coord;

public class LifterBaseOper extends DeviceBase {
    /**
     * 提升机对接伺服设备编号
     */
    private static final PlcOffset SERVO_NO = new PlcOffset(0, null);

    /**
     * 提升机对接伺服故障编号
     */
    private static final PlcOffset ERROR_CODE = new PlcOffset(1, null);


    public LifterBaseOper(PlcDeviceType plcDeviceType, int startNo, String deviceName, int deviceNo, Coord coord,
                          Location location, Coord lockLocation, long deviceId, Integer gridzMax, Integer gridzRelative,
                          int plcId) {
        super(plcDeviceType, startNo, deviceName, deviceNo, coord, location, lockLocation, deviceId, gridzMax,
                gridzRelative, plcId);
    }

    /**
     * 获取提升机对接伺服设备编号
     * @return
     */
    public int getServoNo() {
        return readPlc(SERVO_NO);
    }

    /**
     * 获取提升机对接伺服故障编号
     * @return
     */
    public int getErrorCode() {
        return readPlc(ERROR_CODE);
    }
}
